﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetworkCommsDotNet;
using System.Net;

namespace BACKOFFICE
{
    class Networking2
    {
        public static void StartServerUDP()
        {
            NetworkComms.AppendGlobalIncomingPacketHandler<string>("ChatMessage",
            (packetHeader, connection, incomingString) =>
            {
                Console.WriteLine("\n  ... Incoming message from " +
                    connection.ToString() + " saying '" +
                    incomingString + "'.");
            });
 
            //Start listening for incoming UDP data
            UDPConnection.StartListening(new IPEndPoint(IPAddress.Any, 10000),true);

        }
    }
}
